<template>
	<view style="padding-bottom: 80upx;">
		<view class="box">
			<view class="conter">
				<view class="top">
					<view class="topz">
						<view class="" style="font-size: 40rpx;font-weight: bold;">
							{{list.job_type_name}}
						</view>
						<view class="zi">
							<text>{{ list.company.city_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{ list.company.company_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.work_experience_type_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.edu_type_name}}</text>
						</view>
					</view>
					<view style="font-size: 32rpx;font-weight: bold;color: #3291F8;">
						{{list.salary_range_type_name}}
					</view>
				</view>
				<view class="b-line"></view>
				<view style="padding-top: 32rpx;">
					<view class="" style="display: flex;align-items: center;">
						<image @click="onLineClick(list.company.user_id)" :src="list.company.logo" style="width: 100rpx;height: 100rpx;border-radius: 50%;" mode=""></image>
						<view class="" style="margin-left: 44rpx;">
							<view class="" style="font-size: 35rpx;font-weight: bold;">
								{{list.link_name}}
							</view>
						</view>
					</view>
				</view>
			</view>
			
			<view class="bold-line"></view>
			
			<view class="describe">
				<view class="">
					<view class="" style="font-size: 40rpx;font-weight: bold;margin-bottom: 18rpx;">
						职位描述
					</view>
					<view class="xq">
						<text>{{list.treatment_type_name}}</text>
					</view>
					<view class="describeWord">
						<text>职位职责：</text>
						<text>{{list.job_des}}</text>
					</view>
					<view class="describeWord">
						<text>职位要求：</text>
						<text>{{list.job_des}}</text>
					</view>
				</view>
			</view>
			
			<view class="company" @click="companyDetails()">
				<view style="font-size: 40rpx;font-weight: bold;margin-bottom: 50rpx;">
					公司信息
				</view>
				<view class="address">
					<view class="company_information">
						<view class="topz">
							<view style="font-size: 40rpx;font-weight: bold;margin-left: 30rpx;">
								{{list.company.company_name}}
							</view>
							<view class="zi">
								<text>{{ list.company.city_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.company.scale_type_type_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{list.company.enterprise_type_name}}</text>
							</view>
						</view>
						<view class="topy">
							<image :src="list.company.logo" mode=""></image>
						</view>
					</view>
					<view class="b-line"></view>
					<view style="display: flex; align-items: center; margin-top: 20rpx;">
						<image src="../../../static/dingwei.png" style="width: 48rpx; height: 48rpx;"></image>
						<view style="ccolor: #000; margin: 25rpx 0; font-size: 30rpx;">
							{{list.company.province_name}}-{{list.company.city_name}}-{{list.company.address}}
						</view>
					</view>
					<view style="color: #999999;font-size: 24rpx; margin-left: 10rpx;">{{list.interview_address}}</view>
					<view class="btn-box">
						<view class="check-btn" @click="companyDetails()">查看公司全部职位</view>
					</view>
				</view>
			</view>
			<view class="bold-line"></view>
		</view>
		<view class="btn" v-if="identity==0">
			<view class="dll" @click="toudi">
				投递简历
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default{
		data(){
			return{
				url:'',
				id:'',
				identity:'',
				list:{
					company:{
						logo:''
					}
				}
			}
		},
		onLoad(e) {
			console.log(e)
			this.id=e.id;
			this.identity=e.identity;
			if(e.identity==0){
				this.url='/Index/Index/get_job_info'
			}else if(e.identity==1){
				this.url='/Index/UserCompany/get_job_detail'
			}
			this.details()
		},
		methods:{
			companyDetails(){
				uni.navigateTo({
					url:'./companyDetails?id='+this.list.user_company_id+'&identity='+this.identity
				})
			},
			onLineClick(id){
				uni.navigateTo({
					url:'../../message/msg_lianxi?user_id2='+id,
					success(e) {
						console.log(e)
					},
					fail(e) {
						console.log(e)
					}
				})
			},
			async details(){
				const res= await this.post(this.url,{id:this.id})
				this.list=res.data;
				console.log(res)
			},
			async toudi(){
				const res= await this.post('/Index/User/deliver_job',{id:this.list.id})
				// this.list=res.data;
				console.log(res)
				if(res.code==200){
					uni.showToast({
						title:'投递成功',
						icon:'none',
						duration:1000,
						success: () => {
							setTimeout(()=>{
								uni.navigateTo({
									url:'./delivery'
								})
							},1000)
						}
					})
					// this.$refs.uToast.show({
					// 	title: '投递成功',
					// 	// type: 'success',
					// 	url: '/pages/my/enterprise/delivery'
					// })
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.btn{
		width: 100%;
		background:#FFFFFF;
		padding: 24rpx 100rpx;
		position: fixed;
		bottom: 0;
		.dll {
			width: 100%;
			height: 90rpx;
			color: #FFFFFF;
			font-size: 28rpx;
			line-height: 90rpx;
			text-align: center;
			border-radius: 15rpx;
			background-color: #3291F8;
			border: 1rpx solid #3291F8;
		}
	}
	.company{
		.address{
			padding: 20rpx 35rpx 0 35rpx;
			box-shadow: 0 4upx 10upx 0 rgba(0, 0, 0, 0.1);
			.company_information{
				display: flex;
				justify-content: space-between;
				.topz{
					.zi{
						margin: 20rpx 0 30rpx 55upx;
						text{
							color: #999999;
							font-size: 20rpx;
							margin-right: 10rpx;
						}
					}
				}
				.topy{
					image{
						width: 100rpx;
						height: 100rpx;
						border-radius: 8rpx;
					}
				}
			}
			.btn-box{
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 30rpx;
				.check-btn{
					display: flex;
					align-items: center;
					justify-content: center;
					color: #FFFFFF;
					background: #3291F8;
					padding: 18upx 40upx;
					border-radius: 10upx;
				}
			}
		}
	}
	.describe{
		.xq{
			margin-bottom: 30upx;
			text{
				color: #404040;
				font-size: 24rpx;
				padding: 4px 20rpx;
				background-color: #F2F2F2;
			}
		}
		.describeWord{
			margin-bottom: 76upx;
			text{
				color: #000000;
				display: block;
				margin: 10rpx 0;
				font-size: 30rpx;
			}
		}
	}
	.box{
		padding: 30rpx;
		box-sizing: border-box;
		.conter{
			padding: 30rpx 30upx;
			box-shadow: 0 4upx 10upx 0 rgba(0, 0, 0, 0.1);
			.top{
				.topz{
					.zi{
						color: #999999;
						margin: 20rpx 0;
						font-size: 24rpx;
						text{
							margin-right: 10rpx;
						}
					}
				}
			}
		}
		.bold-line{
			width: 100%;
			height: 15rpx;
			background: #F8F8F8;
			margin: 4rpx 0 54rpx 0;
		}
		.b-line{
			width: 100%;
			height: 2rpx;
			margin-top: 26rpx;
			background: #EEEEEE;
		}
	}
</style>
